﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BulldogCMS.Core;

namespace BulldogCMS.Core.MVC
{
    public class BaseController : System.Web.Mvc.Controller
    {
        protected ActionResult DynamicView(object model = null)
        {
            if (!string.IsNullOrEmpty(Context.Request.CurrentLayoutName))
            {
                return View(Context.Request.CurrentViewName, Context.Request.CurrentLayoutName, model);
            }
            else
            {
                return View(Context.Request.CurrentViewName, model);
            }
        }

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            base.OnActionExecuting(filterContext);
        }

    }
}